<html>
<head><meta charset="utf-8"><title>AliasEq vs ProjectionEq questions · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/AliasEq.20vs.20ProjectionEq.20questions.html">AliasEq vs ProjectionEq questions</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="220712796"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/AliasEq%20vs%20ProjectionEq%20questions/near/220712796" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> FireFighterDuck <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/AliasEq.20vs.20ProjectionEq.20questions.html#220712796">(Dec 22 2020 at 17:15)</a>:</h4>
<p>Hi there, <br>
recently I've been browsing through the source code and trying to connect the different pieces with the theory from the Chalk book to get a better understanding of the code base. I noticed that the comment about to_program_clauses <a href="https://docs.rs/chalk-solve/0.45.0/chalk_solve/clauses/program_clauses/trait.ToProgramClauses.html#method.to_program_clauses-1">here</a> argues about AliasEq whereas the book calls the (as far as I understand) same concept a <a href="https://rust-lang.github.io/chalk/book/clauses/type_equality.html#projection-equality">ProjectionEq</a>. The latter seems to be outdated.<br>
Based on this supposed naming inconsistency I'd like to ask two things:</p>
<ul>
<li>Would it be sensible to simply rename the book parts to match the code?</li>
<li>AliasEq clauses can also be generated from opaque types. Unfortunately, the corresponding section of the book is not yet finished. Is there a semantic difference between the AliasEq generated for opaque types and for associated types?</li>
</ul>



<a name="220718554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/AliasEq%20vs%20ProjectionEq%20questions/near/220718554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/AliasEq.20vs.20ProjectionEq.20questions.html#220718554">(Dec 22 2020 at 18:15)</a>:</h4>
<blockquote>
<p>The latter seems to be outdated.</p>
</blockquote>
<p>Correct</p>



<a name="220718575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/AliasEq%20vs%20ProjectionEq%20questions/near/220718575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/AliasEq.20vs.20ProjectionEq.20questions.html#220718575">(Dec 22 2020 at 18:15)</a>:</h4>
<blockquote>
<p>Would it be sensible to simply rename the book parts to match the code?</p>
</blockquote>
<p>Yep!</p>



<a name="220718817"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/AliasEq%20vs%20ProjectionEq%20questions/near/220718817" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/AliasEq.20vs.20ProjectionEq.20questions.html#220718817">(Dec 22 2020 at 18:18)</a>:</h4>
<blockquote>
<p>AliasEq clauses can also be generated from opaque types. Unfortunately, the corresponding section of the book is not yet finished. Is there a semantic difference between the AliasEq generated for opaque types and for associated types?</p>
</blockquote>
<p>So, this a a bit of Rust "theory", I guess. The answer here is "we aren't sure". The idea I think first was brought up by <span class="user-mention" data-user-id="116009">@nikomatsakis</span> about maybe we can think of associated type aliases similarly to opaque types. The former would be <code>&lt;T as Trait&gt;::Associated = U</code> and the latter as <code>X = U</code></p>



<a name="220718883"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/AliasEq%20vs%20ProjectionEq%20questions/near/220718883" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/AliasEq.20vs.20ProjectionEq.20questions.html#220718883">(Dec 22 2020 at 18:19)</a>:</h4>
<p>Sorry about the docs being out of date. If you find things confusing, missing, or out of date, feel free to file issues. I know we've had a lot of changes over the last year and I don't think we've given enough love to the book.</p>



<a name="220719519"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/AliasEq%20vs%20ProjectionEq%20questions/near/220719519" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> FireFighterDuck <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/AliasEq.20vs.20ProjectionEq.20questions.html#220719519">(Dec 22 2020 at 18:26)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/AliasEq.20vs.20ProjectionEq.20questions/near/220718883">said</a>:</p>
<blockquote>
<p>Sorry about the docs being out of date. If you find things confusing, missing, or out of date, feel free to file issues. I know we've had a lot of changes over the last year and I don't think we've given enough love to the book.</p>
</blockquote>
<p>I'd say it's okay,  in my opinion the book is still a very valuable source to learn about Chalk. That's also why I try to understand and improve it. I will create a PR for the renaming part (probably) tomorrow. Nonetheless, thanks for the explanation.</p>



<a name="220774660"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/AliasEq%20vs%20ProjectionEq%20questions/near/220774660" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> FireFighterDuck <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/AliasEq.20vs.20ProjectionEq.20questions.html#220774660">(Dec 23 2020 at 09:51)</a>:</h4>
<p>As a small follow-up, which reference style is preferred for inter section references, referencing the source <code>md</code> file or the generated <code>html</code> file? <br>
Both styles are already used throughout the book, yet it seems that the latter occurs more often. In addition, both styles generate the same hyperlink but the first would allow for simpler testing in e.g. VS Code.</p>



<a name="220804537"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/AliasEq%20vs%20ProjectionEq%20questions/near/220804537" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/AliasEq.20vs.20ProjectionEq.20questions.html#220804537">(Dec 23 2020 at 16:39)</a>:</h4>
<p>I think we should probably prefer the first</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>